import request from "./useRequests";
import { userinfo } from '@/stores/counter'

export default function resInformation() {
    const user = userinfo()
    async function getResourceInfo(id: string) {
        try {
            const res = await request({
                method: "get",
                url: `/file/resInformation`,
                params: {
                    "id": id,
                },
            })
            user.resources[parseInt(id)] = res.data.data
        } catch (err: any) {
            //alert(err)
        }
    }

    return {
        getResourceInfo
    }
}